A graphics engine, graphics processing unit (GPU), or visual processing unit (VPU), is a specialized electronic circuit designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer typically intended for output to a display. GPUs may be found in embedded systems, mobile phones, tablets, notebook computers, high performance computation (HPC) servers, and game consoles. In addition to manipulating computer graphics in particular, a highly parallel architecture also enables a GPU to more generally perform processing of large blocks of data in parallel.
In the GPU pipeline front-end, scene geometry is processed into primitives, such as triangles having associated vertex data. In the GPU pipeline back-end, depth and color values are assigned to pixels in screen space. Between the geometry and pixel pipelines is a rasterizer, which maps scene geometry to a pixel array, typically outputting tiles, fragments, or groups of a polygon. Polygons are ordered according to their distance from the viewer to properly project a 3D scene into 2D screen space. This sorting is typically performed with a depth buffer or z-buffer. A depth buffer is a rectangular array built up from the depth values of one or more polygon. The depth (or z-value) of each polygon data group output by the rasterizer may be compared against a z-value stored in a depth buffer associated with the same location or position as the group. If the data group is closer to the viewpoint than the value stored in the depth buffer, it is rendered and the depth buffer is updated with the depth values associated with the newly generated data group. If the group is farther from the viewpoint than the value stored in the depth buffer, it is discarded as occluded. The depth buffer is therefore an array with each location in the array storing depth data of the polygon group that is visible from the viewpoint.
A depth-testing algorithm that is more efficient than another without sacrificing accuracy may advantageously reduce memory bandwidth and pixel-level processing associated with rendering a given scene.